package com.tanhua.server.controller;

import com.tanhua.commons.vo.HuanXinUser;
import com.tanhua.server.interceptor.UserHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 环信登录-环信用户信息（app进行环信登录）
 */
@RestController
@RequestMapping("/huanxin")
@Slf4j
public class HuanxinController {

    @RequestMapping(value = "/user",method = RequestMethod.GET)
    public ResponseEntity getUser(){
        //参数1：userId 参数2:123456 参数3：随便写
        log.debug("环信登录了。");///debug  > warn >info  > error   application.yml:error
        return ResponseEntity.ok(new HuanXinUser(UserHolder.getUserId().toString(),"123456","淡水小王"));
    }
}
